﻿using System;
using System.Configuration;
using System.Windows.Forms;
using E4RPTools;
using TakeAway.Controls;

namespace TakeAway
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var controller = new Controller
                                 {
                                     LogFile = ConfigurationManager.AppSettings["LogFile"]
                                 };
            var login = new LoginXtraForm { Controller = controller };
            if (login.ShowDialog() == DialogResult.Cancel)
                return;
            if(!controller.IsLicenseValid())
                return;
            controller.SetShop(ConfigurationManager.AppSettings["Loja"]);
            var main = new MainRibbonForm { Controller = controller };
            Application.Run(main);
        }
    }
}
